import request from '@/utils/request'

// 获取商家列表
export function merchantList(data) {
  return request({
    url: '/merchantSub/search',
    method: 'post',
	data: data
  })
}

// 获取商品列表
export function productList(data) {
  return request({
    url: '/spuInfo/search',
    method: 'post',
	data: data
  })
}

// 下单
export function placeOrder(data) {
  return request({
    url: '/orderInfo/generateOrder',
    method: 'post',
	data: data
  })
}

// 支付
export function payment(params) {
  return request({
    url: '/orderInfo/payment',
    method: 'get',
	params: params
  })
}

// 反馈支付结果
export function paymentResult(params) {
  return request({
    url: '/orderInfo/paymentResult',
    method: 'get',
	params: params
  })
}

// 关闭订单
export function closeOrder(params) {
  return request({
    url: '/orderInfo/closeOrder',
    method: 'get',
	params: params
  })
}

// 退款
export function refund(params) {
  return request({
    url: '/orderInfo/refund',
    method: 'get',
	params: params
  })
}

// 获取订单列表
export function orderList(data) {
  return request({
    url: '/orderInfo/search',
    method: 'post',
	data: data
  })
}